#include <algorithm>
#include <iostream>

using std::cin, std::cout, std::iostream, std::max, std::for_each_n;

constexpr size_t MAX_N {(size_t)5e5+5};
int arr[MAX_N], len[MAX_N], ans1, ans2{1}, n, last_max;

int main(){
    iostream::sync_with_stdio(false), cin.tie(0), cout.tie(0);

    while(cin>>arr[n++]);

    for(int i=0;i<n;i++){
        for(int j=i-1;j>=0;j--){ //j<i
            if(arr[j]>=arr[i] && len[i]<len[j]+1){
                len[i] = len[j] + 1;
            }
        }
    }
    for_each_n(len,n,[](decltype(*len) e){
        ans1 = std::max(ans1,e);
    });
    for(int i=1;i<n;i++){
        if(arr[i]>arr[i-1]){
            ans2++;
        }
    }
    cout<<ans1<<'\n'<<ans2<<'\n';
}

// 40 PT